home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97b.txt / 000118_icon-group-sender _Wed Nov 12 16:25:11 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA07730
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Wed, 12 Nov 1997 16:25:11 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA07668; Wed, 12 Nov 1997 16:25:11 -0700
  7. From: gep2@computek.net
  8. Date: Wed, 12 Nov 1997 14:14:34 -0600
  9. Message-Id: <199711122014.OAA02574@axp.cmpu.net>
  10. Mime-Version: 1.0
  11. Content-Type: text/plain
  12. Content-Transfer-Encoding: 7bit
  13. Subject: Regular Expressions
  14. To: icon-group@optima.CS.Arizona.EDU
  15. X-Mailer: SPRY Mail Version: 04.00.06.17
  16. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  17. Status: RO
  18.  
  19. >For part of a class project I need/like to be able to find all
  20. occanses of a Regular Expression in a ASCII file. Icon seams that is might
  21. be good for this, since one can fine all occurance of a word easly.
  22.  
  23. The problem is that RegExes are a truly braindead way to express a pattern, and 
  24. although RegExes were inspired by SNOBOL4 (which also inspired Icon, of course) 
  25. the RegEx thing is really in a number of ways a different beast than a 
  26. full-fledged pattern match or string scan like you'd do with SNOBOL4/SPITBOL or 
  27. Icon, respectively.
  28.  
  29. If you're looking for something, S*BOL or Icon either one go *way* beyond what 
  30. you might reasonably hope to do with RegExes.
  31.  
  32. >So how would one go about this? 
  33.  
  34. Do you HAVE to use RegExes?  Or are S*BOL patterns or Icon string scanning 
  35. techniques acceptable alternatives?
  36.  
  37. >I'd like to be able to serach for the Reg. Exp. over line breaks if possable.
  38.  
  39. That's fairly trivial, one simple way to do it is to append pairs of consecutive 
  40. lines together prior to the match (assuming that a given match will not extend 
  41. across more than two lines...)
  42.  
  43. Gordon Peterson
  44. http://www.computek.net/public/gep2/
  45. Support the Anti-SPAM Amendment!  Join at http://www.cauce.org/
  46.  
  47.